#include <iostream>
#include <set>
using namespace std;

int main()
{
	multiset<int> s1;
	s1.insert({ 10,20,20,50,50,60,30,20,70 });
	auto pos = s1.find(50);
	while (pos != s1.end() && *pos == 50)
	{
		cout << *pos << " ";
		++pos;
	}
	cout << endl;

	return 0;
}

int main4()
{
	set<int> s1 = { 50,60,10,20,30,40,70 };
	for (auto e : s1)
	{
		cout << e << " ";
	}
	cout << endl;

	auto begin = s1.lower_bound(30);
	auto end = s1.upper_bound(50);
	s1.erase(begin, end);
	for (auto e : s1)
	{
		cout << e << " ";
	}
	cout << endl;

	return 0;
}

int main3()
{
	set<int> s1;
	s1.insert({ 7,5,3 });
	s1.insert(10);
	s1.insert(41);

	for (auto e : s1)
	{
		cout << e << " ";
	}
	cout << endl;

	return 0;
}

int main2()
{
	set<int,greater<int>> s1 = { 7,5,3,1,6,9,8,4,2 };
	auto it1 = s1.begin();
	while (it1 != s1.end())
	{
		cout << *it1 << " ";
		++it1;
	}
	cout << endl;

	return 0;
}

int main1()
{
	set<int> s1 = { 7,5,3,1,6,9,8,4,2 };
	auto it1 = s1.begin();
	while (it1 != s1.end())
	{
		cout << *it1 << " ";
		++it1;
	}
	cout << endl;

	return 0;
}